<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labor_contrasts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id');
            $table->unsignedBigInteger('labor_id');
            $table->unsignedBigInteger('user_id');
            $table->decimal('consult_price', 10, 2)->comment('询价金额');
            $table->date('consult_date')->nullable()->comment('询价日期');
            $table->decimal('quotation_price', 10, 2)->comment('报价金额');
            $table->date('quotation_date')->nullable()->comment('报价日期');
            $table->string('supplier')->default('/')->comment('劳务班组名称');
            $table->string('supplier_personal')->default('/')->comment('负责人名称');
            $table->string('pay_type')->default('/')->comment('付款方式');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labor_contrasts');
    }
};
